<?php include('config.php') ?>
<?php
session_start();

$username=$_POST['email'];
$fName=$_POST['fName'];
$lName=$_POST['lName'];
$uType=$_POST['uType'];
$password=sha1($_POST['pass1']);

$username = stripslashes($username);
$password = stripslashes($password);

$username = mysql_real_escape_string($username);
$password = mysql_real_escape_string($password);

$sql="INSERT INTO `user`(`user_type_ID`,`fName`,`lName`,`email`,`password`) VALUES('$uType','$fName','$lName','$username','$password')";
mysql_query($sql) or die ("Error in query ".mysql_error());

$sql="SELECT * FROM $tbl_name WHERE email='$username' and password='$password'";
$result=mysql_query($sql);
$row = mysql_fetch_array($result);

header("Location: ../index.php");
?>
